<html>
 <head>
  <link href="./leetcode-problem.css" rel="stylesheet" type="text/css">
 </head>
 <body>
  <div class="question_difficulty">
   难度：Medium
  </div>
  <div>
   <h1 class="question_title">
    209. Minimum Size Subarray Sum
   </h1>
   <p>
    Given an array of
    <strong>
     n
    </strong>
    positive integers and a positive integer
    <strong>
     s
    </strong>
    , find the minimal length of a
    <b>
     contiguous
    </b>
    subarray of which the sum &ge;
    <strong>
     s
    </strong>
    . If there isn't one, return 0 instead.
   </p>
   <p>
    <strong>
     Example:&nbsp;
    </strong>
   </p>
   <pre>
<strong>Input:</strong> <code>s = 7, nums = [2,3,1,2,4,3]</code>
<strong>Output:</strong> 2
<strong>Explanation: </strong>the subarray <code>[4,3]</code> has the minimal length under the problem constraint.</pre>
   <div class="spoilers">
    <b>
     Follow up:
    </b>
   </div>
   <div class="spoilers">
    If you have figured out the
    <i>
     O
    </i>
    (
    <i>
     n
    </i>
    ) solution, try coding another solution of which the time complexity is
    <i>
     O
    </i>
    (
    <i>
     n
    </i>
    log
    <i>
     n
    </i>
    ).&nbsp;
   </div>
  </div>
  <div>
   <h1 class="question_title">
    209. 长度最小的子数组
   </h1>
   <p>
    给定一个含有&nbsp;
    <strong>
     n&nbsp;
    </strong>
    个正整数的数组和一个正整数&nbsp;
    <strong>
     s ，
    </strong>
    找出该数组中满足其和
    <strong>
     &ge; s
    </strong>
    的长度最小的连续子数组
    <strong>
     。
    </strong>
    如果不存在符合条件的连续子数组，返回 0。
   </p>
   <p>
    <strong>
     示例:&nbsp;
    </strong>
   </p>
   <pre><strong>输入:</strong> <code>s = 7, nums = [2,3,1,2,4,3]</code>
<strong>输出:</strong> 2
<strong>解释: </strong>子数组&nbsp;<code>[4,3]</code>&nbsp;是该条件下的长度最小的连续子数组。
</pre>
   <p>
    <strong>
     进阶:
    </strong>
   </p>
   <p>
    如果你已经完成了
    <em>
     O
    </em>
    (
    <em>
     n
    </em>
    ) 时间复杂度的解法, 请尝试&nbsp;
    <em>
     O
    </em>
    (
    <em>
     n
    </em>
    log
    <em>
     n
    </em>
    ) 时间复杂度的解法。
   </p>
  </div>
 </body>
</html>